<?php
session_start();
if(!isset($_SESSION['identifiant']) && !isset($_SESSION['webmaster'])){ 
	$_SESSION['identifiant'] = "temp"; 
}else{
	if($_SESSION['est_webmaster'] == 1){
		header('Location: notification.php');
	}else{
		header('Location: informations.php');
	}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
		<title>Jardins familiaux de Lacroix-Falgarde : connexion</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
		<link rel="stylesheet" type="text/css" href="./style/style.css" />
</head>
<body>
	<div id="global">
		<?php include './include/header.php' ;?>
		
		<div id="contenu">
			<?php 
				$identifiant = (isset($_SESSION["identifiant"]) && $_SESSION["identifiant"] != "temp") ? $_SESSION["identifiant"]:"";
			?>
			<fieldset id="conn_fieldset">
			<legend>Connexion</legend>
				<form method="post" action="./login.php">
					<label class="connexion" for="identifiant">Identifiant : </label>
					<input type='text'  name='identifiant' class="text_connection" value='<?php echo $identifiant ?>' /><br/><br/>
					<label class="connexion" for="mdp" >Mot de passe : </label> 
					<input type='password' class="text_connection" name='mdp' />
					<br/><br/>
					
					<div id="bouton">
						<input type="submit" id="bp_connexion" value="Connexion" name="bp_connexion" />
						
					</div>
					<a href="oublie_mdp.php" class="lien_connexion">Mot de passe oublié ?</a><br/><br/>
					<a href="rejoindre.php" class="lien_connexion">Demande d'inscription</a>
					<?php
					if(isset($_SESSION["erreur"]) && !empty($_SESSION["erreur"])){ echo '<div id="erreur"><p>'.$_SESSION["erreur"].'</p></div>';}
					unset($_SESSION["erreur"]);
					?>		
				</form>
				<br/><br/>
			
			</fieldset>
		</div>

		<?php include './include/footer.php' ;?>
	</div>
</body>
</html>
